import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './plugins/element.js'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import './assets/global.css'
import './assets/fonts/iconfont.css'

import axios from 'axios'
Vue.prototype.$http = axios
    // 配置请求的根路径
    // axios.defaults.baseURL = 'http://www.xxr120.xyz:8000'
Vue.config.productionTip = false
Vue.use(ElementUI);
// axios.defaults.baseURL = ''



// 挂载路由导航守卫
// router.beforeEach((to, from, next) => {
//   // to 将要访问的路径
//   // from 代表从那个路径跳转的
//   // next 是一个函数，表示放行
//   //   next 放行      next("/login")  强制跳转
//   if (to.path === '/managelogin') return next();
//   // if (to.path === '/forget') return next();

//   const tokenStr = window.localStorage.getItem('token')
//   if (!tokenStr)
//     return next('/managelogin')
//   else {
//     return next()
//   }
// })
new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')